package com.foreveross.common.Exception;

import com.foreveross.common.Constants;

public class ExceptionConstant {
	
	//文件上传异常代码--文件上传类型不对
	public static String FILE_TYPE_EX = "-1";
	//文件上传异常代码--文件上传为空
	public static String FILE_EMPTY_EX = "-2";
	//文件上传异常代码--文件上传异常
	public static String FILE_UPLOAD_EX = "-3";
	//文件图片上传太大
	public static String FILE_IMA_SIZE_EX = "-4";
	//文件上传太大
	public static String FILE_SIZE_EX = "-5";
	//金额不一致
	public static String PAY_TOTAL_INCONFORMITY = "-6";
	
	public static String getExceptionMessage(String value){
		String message = null;
		if(FILE_TYPE_EX.equals(value)){
			message = "文件上传类型不对"; 
		}else if(FILE_EMPTY_EX.equals(value)){
			message = "文件上传为空"; 
		}else if(FILE_UPLOAD_EX.equals(value)){
			message = "文件上传异常"; 
		}else if(FILE_IMA_SIZE_EX.equals(value)){
			message = "文件图片上传不能超过"+Constants.IMG_MAX_SIZE/(1024*1024)+"M"; 
		}else if(FILE_SIZE_EX.equals(value)){
			message = "文件上传不能超过"+Constants.FILE_MAX_SIZE/(1024*1024)+"M"; 
		}else if(PAY_TOTAL_INCONFORMITY.equals(value)){
			message = "金额不一致";
		}else{
			message = value;
		}
		return message;
	}
	
}



